package com.laolang.shop.modules.member.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.laolang.shop.modules.member.entity.MemberAddressTag;
import com.laolang.shop.modules.member.mapper.MemberAddressTagMapper;
import com.laolang.shop.modules.member.service.MemberAddressTagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;

/**
 * @author khlbat
 * @version 1.0
 * @date 2020/11/1 20:46
 */
@Service
public class MemberAddressTagServiceImpl extends ServiceImpl<MemberAddressTagMapper, MemberAddressTag> implements MemberAddressTagService {

    @Autowired
    private MemberAddressTagMapper memberAddressTagMapper;

    @Transactional(rollbackFor = Exception.class)
    @Override
    public boolean save(MemberAddressTag entity) {
        entity.setVersion(1);
        entity.setCreateTime(LocalDateTime.now());
        return super.save(entity);
    }
}
